namespace CodePlex.CodePlexClientLibrary
{
    [Command("checkout", "Check out a working copy from the repository.", MinArgs = 2, MaxArgs = 3, AltName = "co", UsageSummary = "<tfsUrl> <projectPath> [destination] [options]",
        UsageDescription = @"The TFS URL should be a well-formed URL, such as:

    http://myserver:8080/

The project path is the portion of the source tree you want to check out,
such as:

    $/MyProject/trunk

If destination is omitted, the working copy is placed in the current
directory.")]
    public class CheckoutCommand_Tfs : CheckoutCommand
    {
        protected override void GetCheckoutParameters(out string tfsUrl,
                                                      out string serverPath,
                                                      out string destinationFolder)
        {
            tfsUrl = Arguments[0];
            serverPath = Arguments[1];

            destinationFolder = CodePlexClientUtil.GetFullPath(".");

            if (Arguments.Count > 2)
                destinationFolder = CodePlexClientUtil.GetFullPath(Arguments[2]);
        }
    }
}